﻿
#r "System.Windows.Forms.DataVisualization.dll"

open System
open System.Drawing // for Font
open System.Windows.Forms
open System.Windows.Forms.DataVisualization.Charting

#load "Common.fsx"
open Common // since we didn't define top-level module, so use file name as the module name

let simpleDemo_onlyAdd()=
    let chart = makeChart()

    let area = chart.ChartAreas.[0]
    area.BackColor <- Color.Black
    area.AxisX.MajorGrid.LineColor <- Color.DarkGray
    area.AxisY.MajorGrid.LineColor <- Color.DarkGray

    let series = addSeries chart SeriesChartType.Column
    series.Color <- Color.DarkGreen

    async {
        for index = 1 to 100 do
            if not chart.IsDisposed then
                let y = 100.0 * sin(float(index)/6.0)
                series.Points.Add y |> ignore
                do! Async.Sleep 20
    } |> Async.StartImmediate // start in UI thread, so need to switch context

simpleDemo_onlyAdd()
